package com.nanhai.buddhist.college.module.study.dal.mysql.studyadditionalcourses;

import java.util.*;

import com.nanhai.buddhist.college.framework.common.pojo.PageResult;
import com.nanhai.buddhist.college.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.nanhai.buddhist.college.framework.mybatis.core.mapper.BaseMapperX;
import com.nanhai.buddhist.college.module.study.dal.dataobject.studyadditionalcourses.StudyAdditionalCoursesDO;
import org.apache.ibatis.annotations.Mapper;
import com.nanhai.buddhist.college.module.study.controller.admin.studyadditionalcourses.vo.*;

/**
 * 选课管理 Mapper
 *
 * @author xqenzo@163.com
 */
@Mapper
public interface StudyAdditionalCoursesMapper extends BaseMapperX<StudyAdditionalCoursesDO> {

    default PageResult<StudyAdditionalCoursesDO> selectPage(StudyAdditionalCoursesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudyAdditionalCoursesDO>()
                .likeIfPresent(StudyAdditionalCoursesDO::getCoursesName, reqVO.getCoursesName())
                .eqIfPresent(StudyAdditionalCoursesDO::getLimitStudentCount, reqVO.getLimitStudentCount())
                .eqIfPresent(StudyAdditionalCoursesDO::getStatus, reqVO.getStatus())
                .orderByDesc(StudyAdditionalCoursesDO::getCreateTime));
    }

    default List<StudyAdditionalCoursesDO> selectList(StudyAdditionalCoursesExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<StudyAdditionalCoursesDO>()
                .likeIfPresent(StudyAdditionalCoursesDO::getCoursesName, reqVO.getCoursesName())
                .eqIfPresent(StudyAdditionalCoursesDO::getLimitStudentCount, reqVO.getLimitStudentCount())
                .eqIfPresent(StudyAdditionalCoursesDO::getStatus, reqVO.getStatus())
                .orderByDesc(StudyAdditionalCoursesDO::getCreateTime));
    }

}
